package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.IincInstructionBytecodeEvent;

public class IincInstructionBytecodeEventImpl extends BytecodeEventImpl implements IincInstructionBytecodeEvent
{
    private int localVariableIndex;
    private int increment;

    public IincInstructionBytecodeEventImpl(final int aLocalVariableIndex, final int aIncrement) {
        localVariableIndex = aLocalVariableIndex;
        increment = aIncrement;
    }

    @Override
    public int getType() {
        return IINC_INSTRUCTION;
    }

    @Override
    public void setLocalVariableIndex(final int aLocalVariableIndex) {
        localVariableIndex = aLocalVariableIndex;
    }

    @Override
    public int getLocalVariableIndex() {
        return localVariableIndex;
    }

    @Override
    public void setIncrement(final int aIncrement) {
        increment = aIncrement;
    }

    @Override
    public int getIncrement() {
        return increment;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeMethodVisitor().visitIincInstruction(this);
        return aBytecodeVisitor;
    }
}
